package io.codegeneratetool.web.interceptor;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.HandlerInterceptor;

public abstract class  BaseInterceptor implements HandlerInterceptor {

	protected abstract boolean preHandler(HttpServletRequest request,
			HttpServletResponse response, Object handler) throws Exception;
	
	//月月的,要在pre里面传参,其他几个方法无效
	public boolean preHandle(HttpServletRequest request,
			HttpServletResponse response, Object handler) throws Exception {
		request.setAttribute("base", request.getContextPath());

		return preHandler(  request, response,   handler);
	}

	 

}
